package com.glela.goods.mapper;

import com.glela.goods.model.Product;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductMapper {

	/**
	 * 根据货品id查询货品信息
	 * @author houmf
	 * @param id
	 * @return
	 */
	public Product selectProductById(long id);
	
	public Product selectProductByIdNoStatus(long id);

	/**
	 * 根据商品id查询货品集合
	 * @author houmf
	 * @param goodId
	 * @return
	 */
	public List<Product> selectProductByGoodId(long goodId);

	/**
	 * 根据商品id和规格json查询对应的货品信息
	 * @author houmf
	 * @param goodId
	 * @param specInfo
	 * @return
	 */
	public Product selectProductByGoodIdAndSpecInfo(@Param("goodId") long goodId, 
			@Param("specInfo") String specInfo);

	public String selectproductNoById(long productId);
	
	public String selectIMGBydetailAndGoodID(@Param("DetailId") int specificationDetailId,
			@Param("goodId") long goodId);



	public Product selectProductInfoByGoodIdAndSpecInfo(@Param("goodId") long goodId,@Param("specInfo") String specInfo);

    public void insertSelectiveBatch(@Param("productsNew") List productsNew);
	/**
	 * @Description: 根据商品Id和规格编码查询库存
	 * @Author: zhangrenjie
	 * @Date: 2018/2/1 13:22
	 *
	 */
    public Product selectProductByGoodIdAndProductBn(@Param("goodId") long goodId, @Param("productBn") String productBn);

    Product selectProductByGoodIdAndExtendCode(@Param("goodId") long goodId, @Param("extendCode") long extendCode);

	int updateByPrimaryKeySelective(Product record);
}
